package homeWork.four.demo3;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: sfx
 * Date: 2022-11-30
 * Time: 18:09
 */

class MathDemo{
    public String round(double number){
        String result = String.format("%.2f", number);
        return result;
    }
    public String  round(float number){
        String result = String.format("%.2f", number);
        return result;
    }
}
public class TestDemo {
    public static void main(String[] args) {
        float num1 = 90.83333422f;
        double num2 = 89.8956543343d;
        Math.round(9.0f);
        MathDemo mathDemo = new MathDemo();
        System.out.println(mathDemo.round(num1));
        System.out.println(mathDemo.round(num2));
    }
}
